home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / c / northc / northc1.lzh / include / ctype.h < prev    next >
C/C++ Source or Header  |  1990-08-30  |  992b  |  36 lines

  1. /*
  2.  *    CTYPE.H        Character classification and conversion
  3.  */
  4.  
  5. #ifndef CTYPE_H
  6. #define CTYPE_H
  7.  
  8. extern    unsigned char    _ctype[];
  9.  
  10. #define    _CTc    0x01        /* control character */
  11. #define    _CTd    0x02        /* numeric digit */
  12. #define    _CTu    0x04        /* upper case */
  13. #define    _CTl    0x08        /* lower case */
  14. #define    _CTs    0x10        /* whitespace */
  15. #define    _CTp    0x20        /* punctuation */
  16. #define    _CTx    0x40        /* hexadecimal */
  17.  
  18. #define    isalnum(c)    (_ctype[c]&(_CTu|_CTl|_CTd))
  19. #define    isalpha(c)    (_ctype[c]&(_CTu|_CTl))
  20. #define    iscntrl(c)    (_ctype[c]&_CTc)
  21. #define    isdigit(c)    (_ctype[c]&_CTd)
  22. #define    isgraph(c)    !(_ctype[c]&(_CTc|_CTs))
  23. #define    islower(c)    (_ctype[c]&_CTl)
  24. #define    isprint(c)    !(_ctype[c]&_CTc)
  25. #define    ispunct(c)    (_ctype[c]&_CTp)
  26. #define    isspace(c)    (_ctype[c]&_CTs)
  27. #define    isupper(c)    (_ctype[c]&_CTu)
  28. #define    isxdigit(c)    (_ctype[c]&_CTx)
  29.  
  30. #define    toupper(c)    (islower(c) ? (c)^0x20 : (c))
  31. #define    tolower(c)    (isupper(c) ? (c)^0x20 : (c))
  32. #define    _toupper(c)    ((c)^0x20)
  33. #define    _tolower(c)    ((c)^0x20)
  34.  
  35. #endif CTYPE_H
  36.